﻿// See https://aka.ms/new-console-template for more information

using AisEncodingLib;
using AisEncodingLib.Enums;
using AisEncodingLib.Models;

AisMessageType1Through3 aisMessageType1Through3 = new AisMessageType1Through3()
{
	MessageType = 1,
	RepeatIndicator = 0,
    Mmsi = 265547250,
	NavigationStatus = NavigationStatus.UnderwayUsingEngine,
	RateOfTurn = 3,
	SpeedOverGround = 12.3,
	PositionAccuracy = false,
	Latitude = 29.222,
    Longitude = 119.111,
    CourseOverGround = 3.21,
	TimeStampSecond = 53,
	ManoeuvreIndicator = 0,
	RaimFlag = false,
};
string msg1 = EncodeType.EncodeType1Through3(aisMessageType1Through3);
Console.WriteLine(msg1);

AisMessageType5 aisMessageType5 = new AisMessageType5()
{
	MessageType = 5,
	RepeatIndicator = 0,
    Mmsi = 603916439,
	AisVersion = 0,
    ImoNumber = 439303422,
	CallSign = "ZA83R",
	VesselName = "ARCO AVON",
	ShipType = ShipType.PassengerNoAdditionalInformation,
	DimensionToBow = 113,
    DimensionToStern = 31,
    DimensionToPort =17,
    DimensionToStarboard = 11,
	PositionFixType = EpfdFixType.Gps,
	EtaMonth = 3,
    EtaDay = 23,
    EtaHour = 19,
	EtaMinute = 45,
    Draught10thMetres = 13.2,
	Destination = "HOUSTON",
	IsDteNotReady = true,
};

(string,string) msg5 = EncodeType.EncodeType5(aisMessageType5);
Console.WriteLine(msg5.Item1);
Console.WriteLine(msg5.Item2);


AisMessageType18 aisMessageType18 = new AisMessageType18()
{
	MessageType = 18,
	RepeatIndicator = 0,
	Mmsi = 423302100,
	SpeedOverGround = 1.4,
	PositionAccuracy = true,
	Latitude = 29.222,
	Longitude = 119.111,
    CourseOverGround = 177,
	TrueHeadingDegrees = 177,
    TimeStampSecond = 34,
	CsUnit = ClassBUnit.Cstdma,
	HasDisplay = true,
	IsDscAttached = true,
	CanSwitchBands = true,
	CanAcceptMessage22ChannelAssignment = true,
	IsAssigned = false,
	RaimFlag = false,
	RadioStatusType = ClassBRadioStatusType.Itdma
};

string msg18 = EncodeType.EncodeType18(aisMessageType18);
Console.WriteLine(msg18);

AisMessageType19 aisMessageType19 = new AisMessageType19()
{
	MessageType = 19,
	RepeatIndicator = 0,
	Mmsi = 601000013,
	SpeedOverGround = 2.9,
	PositionAccuracy = false,
	Latitude = 29.222,
	Longitude = 119.111,
	CourseOverGround = 89,
	TrueHeadingDegrees = 90,
	TimeStampSecond = 12,
	ShipName = "TEST NAME CLSB MSG19",
    ShipType = ShipType.PleasureCraft,
	DimensionToBow = 7,
	DimensionToStern = 6,
	DimensionToPort = 2,
	DimensionToStarboard = 3,
	PositionFixType = EpfdFixType.Gps,
	IsAssigned = false,
	RaimFlag = false,
	IsDteNotReady = true
};
(string, string) msg19 = EncodeType.EncodeType19(aisMessageType19);
Console.WriteLine(msg19.Item1);
Console.WriteLine(msg19.Item2);

AisMessageType24A aisMessageType24A = new AisMessageType24A()
{
	MessageType = 24,
	RepeatIndicator = 0,
	Mmsi = 112233445,
	ShipName = "THIS IS A CLASS B UN"
};
string msg24A = EncodeType.EncodeType24A(aisMessageType24A);
Console.WriteLine(msg24A);

AisMessageType24B aisMessageType24B = new AisMessageType24B()
{
	MessageType = 24,
	RepeatIndicator = 0,
	Mmsi = 112233445,
	ShipType = ShipType.Sailing,
	MothershipMmsi = "1234567",
	CallSign = "CALLSIG",
	DimensionToBow = 5,
	DimensionToPort = 3,
	DimensionToStarboard = 12,
	DimensionToStern = 4,
	PositionFixType = EpfdFixType.Galileo
};
string msg24B = EncodeType.EncodeType24B(aisMessageType24B);
Console.WriteLine(msg24B);

// 27
AisMessageType27 aisMessageType27 = new AisMessageType27()
{
	MessageType = 27,
	RepeatIndicator = 0,
	Mmsi = 357277000,
	NavigationStatus = NavigationStatus.Moored,
	Longitude = 119.111,
	Latitude = 29.222,
	PositionAccuracy = true,
	RaimFlag = false,
	CourseOverGround = 11,
	SpeedOverGround = 0
};
string msg27 = EncodeType.EncodeType27(aisMessageType27);
Console.WriteLine(msg27);
